package cn.zqh.store;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import feign.Request;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

/**
 * @Author: zqh
 * @Date: 2023-01-06-10:20
 * @Description: 商店的启动类$
 */
@SpringBootApplication
@MapperScan("cn.zqh.store.mapper")
@EnableDiscoveryClient
@EnableFeignClients
public class StoreApplication {
    public static void main(String[] args) {
        SpringApplication.run(StoreApplication.class, args);
    }

    /**
     * @Author: zqh
     * @Date:
     * @Description: 远程调用轮询
     */
    @Bean
    public IRule randomRule(){
        return new RandomRule();
    }

    @Bean
    public Request.Options feignOptions() {
        return new Request.Options(6000, 6000);
    }
}
